﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Prices.CheckRate.aspx.cs"
    Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Check Rate</title>
    <script src="assets/js/Admin_002.js" type="text/javascript"></script>
    <script src="assets/js/Admin.js" type="text/javascript"></script>
    <script src="assets/js/Validation.js" type="text/javascript"></script>
    <script src="assets/js/jquery-1.4.2.js" type="text/javascript"></script>
    <%--<script type="text/javascript"
		src="http://code.jquery.com/jquery-1.5.2.min.js"></script>--%>
    <script src="assets/jquery/jquery-ui.min.js" type="text/javascript"></script>
    <script src="assets/jquery/jquery.dialog.extra.js" type="text/javascript"></script>
    <script type='text/javascript' src="assets/js/jquery.bgiframe.min.js"></script>
    <script type='text/javascript' src="assets/js/jquery.ajaxQueue.js"></script>
    <script type='text/javascript' src="assets/js/thickbox-compressed.js"></script>
    <script type='text/javascript' src="assets/js/jquery.autocomplete.js"></script>
    <script type='text/javascript' src="assets/js/Ports.js"></script>
    <script type='text/javascript' src="Assets/js/jquery-custom-1.0.0.js?v=0611"></script>
    <script type='text/javascript' src="Assets/js/zoom.js"></script>
    <script type='text/javascript' src="assets/js/Carrs.js"></script>
    <script type='text/javascript' src="Assets/js/updateprice.js"></script>
    <script type='text/javascript' src="Assets/js/encoder.js"></script>
    <script type='text/javascript' src="Assets/jquery/jquery.cookie.js"></script>
    <link href="assets/jquery/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="assets/css/jquery.autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="assets/css/thickbox.css" />
    <link rel="stylesheet" href="assets/css/reset.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/styleexpress.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/invalid.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="Assets/css/EditTableCell.css" type="text/css" />
    <link rel="stylesheet" href="Assets/css/zoom.css" type="text/css" />
    <script type="text/javascript" language="javascript">
        var nPermissions = '<%=nPermissions %>';
        function getUrlVars() {
            var vars = {};
            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                vars[key] = value;
            });
            return vars;
        }
        function doPublic(strID, strName) {
            //if (confirm('Bạn có thực sự muốn public ' + strName + '?')) {
            var vnpage = getUrlVars()['page_number'];
            if (vnpage)
                window.location.href = "Prices.CheckRate.aspx?action=public&ID=" + strID + "&page_number=" + vnpage;
            else
                window.location.href = "Prices.CheckRate.aspx?action=public&ID=" + strID;
            //}
        }
        $().ready(function () {
            $('#txtCarrName').focus().autocomplete(carrs);
            $('#txtPortTo').focus().autocomplete(ports);
            $('#txtPortFrom').focus().autocomplete(ports);
            $('#txtPortToSearch').focus().autocomplete(ports);
            $('#txtPortFromSearch').focus().autocomplete(ports);
            $(".LeaveRow").on('click', function () {
                var selected = new Array();
                var pID = $(this).attr("PID");
                if ($.cookie("PriceCheckRate") != null && $.cookie("PriceCheckRate") != "") {
                    selected = $.cookie("PriceCheckRate").split(',');
                    var newFilter = pID;
                    var found = jQuery.inArray(newFilter, selected);
                    if (found >= 0) {
                        selected.splice(found, 1);
                        $.cookie("PriceCheckRate", Encoder.htmlEncode(selected.toString()));
                    }
                }
                $(this).parent().parent().fadeOut("fast");
            });
        });
        function viewSchedules(POL, POD, CarrID) {
            jQuery.ajax({
                type: "POST",
                url: "AjaxFile/ViewShedulesFromPrice.ashx?POL=" + POL + "&POD=" + POD + "&CarrID=" + CarrID,
                success: function (msg) {
                    var vcontent = "#shedule" + CarrID;
                    $(vcontent).attr("title", msg);
                    //                    $(vcontent).tooltip({
                    //                        track: true,
                    //                        delay: 0,
                    //                        showURL: false,
                    //                        showBody: " - ",
                    //                        fade: 250
                    //                    });
                }
            });

        }
        function doOpenService(POL, POD, CarrID) {
            var url = "Carrier.Services.aspx?POL=" + POL + "&POD=" + POD + "&CarrID=" + CarrID;
            window.open(url, '_blank', 'width=850,height=800,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0', '_blank');
            window.focus();
        }
        function doClearRatesSelected() {
            $.cookie("PriceCheckRate", null);
            location.reload();
        }
        function liveRow(obj, pID) {
            //            var selected = new Array();
            //            if ($.cookie("PriceCheckRate") != null && $.cookie("PriceCheckRate") != "") {
            //                selected = $.cookie("PriceCheckRate").split(',');
            //                var newFilter = pID;
            //                var found = jQuery.inArray(newFilter, selected);
            //                if (found >= 0) {
            //                    selected.splice(found, 1);
            //                    $.cookie("PriceCheckRate", Encoder.htmlEncode(selected.toString()));
            //                }
            //            }
            alert($(obj).parent().parent());
            //$(this).parent().parent().remove();
        }
    </script>
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <div class="content-box">
                <form id="frmPrices" runat="server" autocomplete="off">
                <div zoomable="true">
                    <div class="content-box-header">
                        <h3 style="cursor: s-resize;">
                            CHECK RATES</h3>
                        <div class="clear">
                        </div>
                    </div>
                    <div>
                        <div>
                            <table class="adminedit" style="border: none">
                                <tr>
                                    <td align="left">
                                        <div class="clear">
                                        </div>
                                        POL:
                                        <asp:DropDownList ID="ddPOL" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddPOL_SelectedIndexChanged">
                                        </asp:DropDownList>
                                        POD:
                                        <asp:DropDownList ID="ddPOD" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddPOD_SelectedIndexChanged">
                                        </asp:DropDownList>
                                        Select Carr: &nbsp;
                                        <asp:DropDownList ID="ddCarrID" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddCarrID_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td>
                                        <input type="button" id="btnClear" value="Clear" onclick="doClearRatesSelected();"
                                            class="button" style="float: right; margin-left: 10px; font-weight: bold;" />
                                        <input type="button" style="float: right; margin-left: 10px; width: 50px; font-weight: bold;"
                                            class="button" value="Edit" id="btnsave" runat="server" visible="false" />
                                        <asp:Button Style="float: right; margin-left: 10px; width: 50px; font-weight: bold;"
                                            class="button" Text="Add" ID="btAddRateOfCarr" runat="server" OnClick="btAddRateOfCarr_Click" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <%=strAlphaBet%>
                    <fieldset>
                        <%--<div style="margin: 10px;">
                            <input type="button" style="float: right; margin-left:10px;" class="button" value="Edit" id="btnsave" runat="server" visible="false" />
                            <asp:Button  ID="btnInit" CssClass="button" style="float:right;"  runat="server" TabIndex="15"
                                Text="Save" OnClick="btnSave_Click" />
                            <div style="float: right" id="selectcolumn">
                            </div>
                            <div style="clear: both;">
                            </div>
                        </div>--%>
                        <asp:Repeater ID="rptData" runat="server">
                            <ItemTemplate>
                                <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'"
                                    priceid='<%#Eval("ID") %>'>
                                    <td align="center" title="Index" width="28px" style="min-width: 28px; max-width: 28px;
                                        overflow: hidden;">
                                        <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "PortTo")%>
                                    </td>
                                    <td>
                                        <%# DataBinder.Eval(Container.DataItem, "PortFrom")%>
                                    </td>
                                    <td width="50px" style="min-width: 50px; max-width: 50px; overflow: hidden;">
                                        <b>
                                            <%# DataBinder.Eval(Container.DataItem, "CarrID")%>
                                        </b>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="DC20" title='<%#GetCellTitle(Eval("DC20")) %>' class='<%#GetCellClass(Eval("DC20"))%>'>
                                        <%#GetCellValue(DataBinder.Eval(Container.DataItem, "DC20"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="DC40" title='<%#GetCellTitle(Eval("DC40")) %>' class='<%#GetCellClass(Eval("DC40"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "DC40"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="HC40" title='<%#GetCellTitle(Eval("HC40")) %>' class='<%#GetCellClass(Eval("HC40"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "HC40"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="CONT45" title='<%#GetCellTitle(Eval("CONT45")) %>' class='<%#GetCellClass(Eval("CONT45"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "CONT45"))%>
                                    </td>
                                    <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                        code="ValidityEx" title='<%#GetCellTitle(Eval("ValidityEx")) %>' class='<%#GetCellClass(Eval("ValidityEx"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "ValidityEx"))%>
                                    </td>
                                    <td editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;" title='<%#GetCellTitle(Eval("DescriptionEx")) %>'
                                        code='DescriptionEx' class='<%#GetCellClass(Eval("DescriptionEx"))%>'>
                                        <%#GetCellValue( DataBinder.Eval(Container.DataItem, "DescriptionEx"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="RF20" title='<%#GetCellTitle(Eval("RF20")) %>' class='<%#GetCellClass(Eval("RF20"))%>'>
                                        <%#GetCellValue( DataBinder.Eval(Container.DataItem, "RF20"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="RF40" title='<%#GetCellTitle(Eval("RF40")) %>' class='<%#GetCellClass(Eval("RF40"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "RF40"))%>
                                    </td>
                                    <td width="60px" editable="true" style="min-width: 60px; max-width: 60px; overflow: hidden;"
                                        code="Validity" title='<%#GetCellTitle(Eval("Validity")) %>' class='<%#GetCellClass(Eval("Validity"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "Validity"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px;" code="Description"
                                        title='<%#GetCellTitle(Eval("Description")) %>' class='<%#GetCellClass(Eval("Description"))%>'>
                                        <%#GetCellValue( DataBinder.Eval(Container.DataItem, "Description"))%>
                                    </td>
                                    <%--OTFL--%>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="OT20" title='<%#GetCellTitle(Eval("OT20")) %>' class='<%#GetCellClass(Eval("OT20"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "OT20"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="OT40" title='<%#GetCellTitle(Eval("OT40")) %>' class='<%#GetCellClass(Eval("OT40"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "OT40"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="FL20" title='<%#GetCellTitle(Eval("FL20")) %>' class='<%#GetCellClass(Eval("FL20"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "FL20"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="FL40" title='<%#GetCellTitle(Eval("FL40")) %>' class='<%#GetCellClass(Eval("FL40"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "FL40"))%>
                                    </td>
                                    <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                        code="ValidityOTFL" title='<%#GetCellTitle(Eval("ValidityOTFL")) %>' class='<%#GetCellClass(Eval("ValidityOTFL"))%>'>
                                        <%# GetCellValue(DataBinder.Eval(Container.DataItem, "ValidityOTFL"))%>
                                    </td>
                                    <td editable="true" style="min-width: 50px; overflow: hidden;" title='<%#GetCellTitle(Eval("DescriptionOTFL")) %>'
                                        code='DescriptionOTFL' class='<%#GetCellClass(Eval("DescriptionOTFL"))%>'>
                                        <%#GetCellValue( DataBinder.Eval(Container.DataItem, "DescriptionOTFL"))%>
                                    </td>
                                    <%--<td width="50px" style="color: #0000ff; min-width: 50px; max-width: 50px; overflow: hidden;"
                                            code="update">
                                            <%#DataBinder.Eval(Container.DataItem, "LastUpdate")%>
                                        </td>--%>
                                    <%if ((Session["prices"] != null) && (int.Parse(Session["prices"].ToString()) >= 3))
                                          {%>
                                    <td align="center">
                                        <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                    </td>
                                    <%} %>
                                </tr>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <div autofit="true" style="">
                                    <table editcellcontent="true" cellspacing="0" cellpadding="0" width="auto" border="0"
                                        class="adminlist" resizeable="true">
                                        <thead>
                                            <tr>
                                                <th align="center">
                                                    Index
                                                </th>
                                                <th align="center">
                                                    POL
                                                </th>
                                                <th align="center">
                                                    POD
                                                </th>
                                                <th align="center" class="resizeable">
                                                    Carr
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="DC20">
                                                    DC20
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="DC40">
                                                    DC40
                                                </th>
                                                <th class="resizeable unviewable" code="HC40">
                                                    HC40
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="CONT45">
                                                    45'
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="ValidityEx">
                                                    Validity
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="DescriptionEx">
                                                    Note
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="RF20">
                                                    RF20
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="RF40">
                                                    RF40
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="Validity">
                                                    Validity
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="Description">
                                                    Note
                                                </th>
                                                <%--OTFL--%>
                                                <th class="resizeable unviewable" code="OT20">
                                                    OT20
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="OT40">
                                                    OT40
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="FL20">
                                                    FL20
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="FL40">
                                                    FL40
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="ValidityOTFL">
                                                    Validity
                                                </th>
                                                <th align="center" class="resizeable unviewable" code="DescriptionOTFL">
                                                    Note
                                                </th>
                                                <%--<th align="center" code="update">Update
                                                    </th>--%>
                                                <%if ((Session["prices"] != null) && (int.Parse(Session["prices"].ToString()) >= 3))
                                                      {%>
                                                <th align="center">
                                                    #
                                                </th>
                                                <%} %>
                                            </tr>
                                        </thead>
                            </HeaderTemplate>
                            <FooterTemplate>
                                </TABLE> </div>
                            </FooterTemplate>
                        </asp:Repeater>
                    </fieldset>
                    <div class="clear">
                    </div>
                    <div id="footer">
                        <%=strPager%>
                    </div>
                </div>
                </form>
            </div>
        </div>
    </div>
    <span id="ruler" style="visibility: hiddens; white-space: nowrap"></span>
</body>
</html>
